cmake_minimum_required(VERSION 3.1.0)
project(TESTSO CXX)

function(printparam p1 p2 p3)
    message(STATUS "p1 = ${p1}")
    message(STATUS "p2 = ${p2}")
    message(STATUS "p3 = ${p3}")

    message(STATUS "ARGC = ${ARGC}")
    message(STATUS "ARGV = ${ARGV}")
    message(STATUS "ARGN = ${ARGN}")

    math(EXPR ARGC_1 "${ARGC} - 1")
    message(STATUS "ARGC_1 = ${ARGC_1}")
    foreach(number RANGE ${ARGC_1})
        message(STATUS "ARGV${number} = ${ARGV${number}}")
    endforeach()
    
endfunction()

printparam(111 222 333 444 555 666 777)
printparam(888 999)

